<template>
  <div class="list-container">
    <div class="sortList clearfix">
      <div class="center">
        <!--banner轮播-->
        <div>
          <el-carousel height="500px">
            <el-carousel-item v-for="item in bannerList" :key="item.id">
              <a :href="item.url">
                {{  }}
                <img :src="item.img" style="width: 730px;">
              </a>
              
            </el-carousel-item>
          </el-carousel>
          <!-- <div class="swiper-wrapper">
              <div class="swiper-slide">
                <a>
                  <img width="730px" src="./images/img-banner.png" alt=""/>
                </a>
              </div>
            </div> -->
        </div>
      </div>
      <div class="right">
        <div class="news">
          <h4>
            <em class="fl">汽车之家快报</em>
            <span class="fr tip">更多 ></span>
          </h4>
          <div class="clearix"></div>
          <ul class="news-list unstyled">
            <li>
              <span class="bold">[公告]</span>购车火热季 全民半价购爱车
            </li>
            <li>
              <span class="bold">[公告]</span>汽车之家成功上线
            </li>
            <li>
              <span class="bold">[公告]</span>汽车之家测试啦
            </li>
          </ul>
        </div>

      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "index",
  data(){
    return{
      bannerList:[
        {
          //img: 'img/img-banner-1.png',
          img:'http://101.43.12.19:8082/file/0d780620671c47f3abe3a0d9fe64bd60.png',
          url:'http://101.43.12.19/#/car/detail/6'
        },
        {
          //img: 'img/img-banner-2.png',
          img:'http://101.43.12.19:8082/file/b100122d238c4dd78a60a1aaa0947a4c.png',
          url:'http://101.43.12.19/#/car/detail/7'
        },
        {
          //img: 'img/img-banner-3.png',
          img:'http://101.43.12.19:8082/file/d473bc78b31a4e1b808fbf8f2b52f5a0.png',
          url:'http://101.43.12.19/#/car/detail/8'
        }

      ],
    }
  }
}
</script>

<style lang="less" scoped>
.list-container {
  width: 1200px;
  margin: 0 auto;

  .sortList {
    height: 464px;
    padding-left: 210px;

    .center {
      box-sizing: border-box;
      width: 740px;
      height: 100%;
      padding: 5px;
      float: left;
    }

    .right {
      float: left;
      width: 250px;

      .news {
        border: 1px solid #e4e4e4;
        margin-top: 5px;

        h4 {
          border-bottom: 1px solid #e4e4e4;
          padding: 5px 10px;
          margin: 5px 5px 0;
          line-height: 22px;
          overflow: hidden;
          font-size: 14px;

          .fl {
            float: left;
          }

          .fr {
            float: right;
            font-size: 12px;
            font-weight: 400;
          }
        }

        .news-list {
          padding: 5px 15px 280px 5px;
          line-height: 26px;

          .bold {
            font-weight: 700;
          }
        }
      }

      .lifeservices {
        border-right: 1px solid #e4e4e4;
        overflow: hidden;
        display: flex;
        flex-wrap: wrap;

        .life-item {
          border-left: 1px solid #e4e4e4;
          border-bottom: 1px solid #e4e4e4;
          margin-right: -1px;
          height: 64px;
          text-align: center;
          position: relative;
          cursor: pointer;
          width: 25%;

          .list-item {
            background-image: url(images/img-banner.png);
            width: 61px;
            height: 40px;
            display: block;
          }

          .service-intro {
            line-height: 22px;
            width: 60px;
            display: block;
          }

          &:nth-child(1) {
            .list-item {
              background-position: 0px -5px;
            }
          }

          &:nth-child(2) {
            .list-item {
              background-position: -62px -5px;
            }
          }

          &:nth-child(3) {
            .list-item {
              background-position: -126px -5px;
            }
          }

          &:nth-child(4) {
            .list-item {
              background-position: -190px -5px;
            }
          }

          &:nth-child(5) {
            .list-item {
              background-position: 0px -76px;
            }
          }

          &:nth-child(6) {
            .list-item {
              background-position: -62px -76px;
            }
          }

          &:nth-child(7) {
            .list-item {
              background-position: -126px -76px;
            }
          }

          &:nth-child(8) {
            .list-item {
              background-position: -190px -76px;
            }
          }

          &:nth-child(9) {
            .list-item {
              background-position: 0px -146px;
            }
          }

          &:nth-child(10) {
            .list-item {
              background-position: -62px -146px;
            }
          }

          &:nth-child(11) {
            .list-item {
              background-position: -126px -146px;
            }
          }

          &:nth-child(12) {
            .list-item {
              background-position: -190px -146px;
            }
          }
        }
      }

      .ads {
        margin-top: 5px;

        img {
          opacity: 1;
          transition: all 400ms;

          &:hover {
            opacity: 0.8;
          }
        }
      }
    }
  }
}
</style>
